Skip to content

Conversation

xfra35
Copy link
Contributor

@xfra35 xfra35 commented Aug 28, 2015

Since the plugin handles only one modal at a time, the need may arise to have one modal:close trigger another modal:open in order to implement state management. Here's an example:

$modal1.on('modal:close',function(){
  $modal2.modal();
});

This doesn't play nicely with the current codebase: $modal2 shows up but stop responding afterwards (uncloseable). The reason is that the current instance gets destroyed by the first modal close() call.

This PR intends to fix that by adding a simple check before destroying the current instance.

NB: Unsubscribing to keydown.modal is performed a bit earlier for the same reason: this.hide() may trigger another modal:open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant